<template>
  <div >
    <h3 align="center">投递简历</h3>
    <el-form ref="form" :model="applyForm" label-width="100px">

      <el-form-item label="请输入姓名">
        <el-input v-model="applyForm.applyName" style="width: 20%;"></el-input>
      </el-form-item>

      <el-form-item label="请输入性别">
        <el-select v-model="applyForm.applySex" placeholder="请选择性别">
          <el-option label="男" value="男"></el-option>
          <el-option label="女" value="女"></el-option>
        </el-select>
      </el-form-item>

      <el-form-item label="请输入出生日期">
        <el-col :span="11">
          <el-date-picker type="date" placeholder="选择日期" v-model="applyForm.applyBir" value-format="yyyy-MM-dd" style="width: 40%;">
          </el-date-picker>
        </el-col>
      </el-form-item>

      <el-form-item label="请输入电话">
        <el-input v-model="applyForm.applyPhone" style="width: 20%;"></el-input>
      </el-form-item>

      <el-form-item label="请输入学历">
        <el-select v-model="applyForm.applyEducation" placeholder="学历">
          <el-option label="小学" value="小学"></el-option>
          <el-option label="初中" value="初中"></el-option>
          <el-option label="高中" value="高中"></el-option>
          <el-option label="专科" value="专科"></el-option>
          <el-option label="本科" value="本科"></el-option>
          <el-option label="硕士" value="硕士"></el-option>
          <el-option label="博士" value="博士"></el-option>

        </el-select>
      </el-form-item>

      <el-form-item label="请输入邮箱地址">
        <el-input v-model="applyForm.applyEmail" style="width: 20%;"></el-input>
      </el-form-item>

      <el-form-item label="请输入应聘岗位">
        <el-input v-model="applyForm.applyJob" style="width: 20%;"></el-input>
      </el-form-item>

      <el-form-item label="请输入应聘日期">
        <el-col :span="11">
          <el-date-picker type="date" placeholder="选择日期" v-model="applyForm.applyDate" value-format="yyyy-MM-dd" style="width: 40%;">
          </el-date-picker>
        </el-col>
      </el-form-item>

      <el-button type="primary" @click="add" size="mini">投递简历</el-button>
    </el-form>
  </div>

</template>

<script>
  export default {
    name: "applyAdd",
    data() {
      return {
        applyList: [],
        title: "新增", //模态框的标题
        applyForm: { //表单请求对象
          applyId: null,
          applyName: "",
          applySex: "",
          applyBir: "",
          applyPhone: "",
          applyEducation: "",
          applyEmail: "",
          applyJob: "",
          applyDate: "",
          applyStatus: "未处理"
        },
      }
    },
    methods: {
      add() {
        var mythis = this;
        $.ajax({
          url: "http://localhost:8080/apply/add",
          type: "get",
          data: mythis.applyForm,
          dataType: "json",
          success: function(data) {
            if (data.info == "保存成功") {
              mythis.$message({
                type: 'success',
                message: '投递成功!'
              });
            }
          }
        })
      },
    },
  }
</script>

<style>
</style>
